package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.service.IChatMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("chatMessages")
public class ChatMessagesController {
    @Autowired
    private IChatMessageService chatMessageService;

    //获得用户的未读信息数量
    @GetMapping("{userId}/unreads")
    public Integer countForUnreadByUserid(@PathVariable Long userId){
        return chatMessageService.countForUnreadByUserId(userId);
    }
}
